/*

This program sets up your Arduino for use with the Adafruit motor driver on a JBOT,
then has the bot go forward for 2 seconds and stop.

*/

#include <AFMotor.h> // Enables the Motor library

AF_DCMotor motor1(1); // Motor 1 is connected to the port 1 on the motor shield
AF_DCMotor motor2(2); // Motor 2 is connected to the port 2 on the motor shield
int sonic;
void setup()// This set of commands is the first run, and only runs once.
{
motor1.setSpeed(215); // Sets the speed of the first motor (At 0, the motors are turned off. 255 is the fastest setting that you are able to use, I used 215 to not push the motors too hard.)
motor2.setSpeed(215); // Sets the speed of the second motor (At 0, the motors are turned off. 255 is the fastest setting that you are able to use, I used 215 to not push the motors too hard.)

Serial.begin(9600); // Enables Serial monitor for debugging purposes
Serial.println("Serial test!"); // Test the Serial communication
  motor1.run(FORWARD); // Motor 1 goes forward
motor2.run(FORWARD); // Motor 2 goes forward
delay(2000);// Allows motors to run for 2 seconds

motor1.run(RELEASE); //Stops motor 1
motor2.run(RELEASE); // Stops motor 2

}

void loop() //This set of commands runs after the setup, and as the name suggests, loops indefinatly.
            //Anything that you want to run once should be put in the setup.
            {
            }
